<script>
export default {
  onLaunch: function(e) {
    const _this = this;
    uni.getStorage({
      key: 'roleCode',
      success(res) {
        _this.globalData.roleCode = res.data;
      },
      fail() {
        uni.reLaunch({
          url: '/pages/account/login'
        });
        _this.$isResolve();
      }
    });

    uni.getStorage({
      key: 'token',
      success(res) {
        _this.globalData.token = res.data;
        _this.$isResolve();
      },
      fail() {
        uni.reLaunch({
          url: '/pages/account/login'
        });
        _this.$isResolve();
      }
    });

    uni.getStorage({
      key: 'username',
      success(res) {
        _this.globalData.username = res.data;
        _this.$isResolve();
      },
      fail() {
        uni.reLaunch({
          url: '/pages/account/login'
        });
        _this.$isResolve();
      }
    });
  },
  onShow: function() {
    console.log('App Show');
  },
  onHide: function() {
    console.log('App Hide');
  },
  globalData: {
    token: '',
    roleCode: '',
    userName: ''
  },
  methods: {
    // 获取微信签名
    getSignature() {}
  }
};
</script>

<style lang="less">
/*每个页面公共css */
@import url('@/common/less/common.less');
@import url('@/common/less/base.less');
</style>
